class CreatePrices < ActiveRecord::Migration
  def self.up
    create_table :prices do |t|
      t.decimal :price         ,:null => false , :precision => 8, :scale => 2  #产品的价格
      t.integer :product_id    ,:null => false                                 #产品的ID
      t.text :description                                               #描述
      t.integer :is_locked     ,:limit => 1 ,:default => 0 #锁定 1为True 0为False
      t.integer :lock_version  , :default => 0  #乐观锁
      t.timestamps
    end
  end

  def self.down
    drop_table :prices
  end
end
